//
//  UIView+SKGradient.m
//  skhr
//
//  Created by sujeking on 2018/6/22.
//  Copyright © 2018年 sujeking. All rights reserved.
//

#import "UIControl+SKGradient.h"

@implementation UIControl (SKGradient)

+ (CAGradientLayer *)getGradientColor:(NSArray *)colors direction:(NSInteger)direction {
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    gradientLayer.colors = colors;
    gradientLayer.locations = @[@0.0, @0.5, @1.0];
    gradientLayer.startPoint = CGPointMake(0, 0);
    gradientLayer.endPoint = CGPointMake(1.0, 0);
    return gradientLayer;
}

@end
